Skip to content

feat(build): 支持构建系统声明自己的检测忽略规则 - #218

Merged
xiaoyumuxi merged 11 commits into
Lithe-IDEA:mainfrom
WhiteZeek:feat/2485-build-ignore
Nov 29, 2026
Merged

xiaoyumuxi merged 11 commits into
Lithe-IDEA:mainfrom
WhiteZeek:feat/2485-build-ignore

Conversation

@WhiteZeek

@WhiteZeek WhiteZeek commented Nov 28, 2026 •

Copy link
Copy Markdown
Contributor

关联 Issue / Linked issue

Refs 1lck/Lithe-IDEA#2485

PR 类型 / Type

  • feat

改动说明 / What changes

工作区里可能同时有多个构建系统。过去,插件只要找到标记文件,就把所在目录识别为构建实例。测试夹具和依赖副本因此也会触发模型同步。

  • 在 buildSystems 0 的 detection 中增加可选的 ignoredPaths。沿用工作区的 gitignore 匹配和校验,每组最多 256 条,每条最多 1024 UTF-8 字节。清单有误时返回出错字段。
  • 复用一次工作区扫描。在判断嵌套关系前,按每个胜出声明过滤标记目录及其祖先。工作区规则优先,用户可用否定模式恢复目录。其他构建系统仍可识别同一目录。
  • build.detect 有插件规则时返回 pluginIgnoredPaths,包含插件、构建系统、显示名称和原始规则。即使该系统没有实例也可显示来源。
  • 更新 schema、契约、示例清单、更新记录和回归测试。旧宿主会拒绝含新字段的清单,使用新字段的插件应与兼容宿主协调发布。

类型专属:feat

  • 共享 Rust 实现适用于 macOS 和 Windows。
  • 桌面端设置展示、Core 固定版本和具体插件清单由各自仓库跟进。宿主功能矩阵随桌面端接线更新。

范围检查

  • 未新增宿主方法、插件权限、后台任务、存储格式或 SDK 调用。沿用既有清单拒绝流程和日志。
  • 目录过滤只影响当前构建系统。文件树、搜索和索引继续使用原来的规则。

清单 schema 现在检查注释、空否定、控制字符和模式首尾的空白;契约列出打包前调用 plugins.declarative.validate 的输入和返回值,用于检查实际 glob 和 UTF-8 字节数。

验证

  • node shared/plugins/scripts/verify-docs.mjs
  • git diff --check
  • Windows x64 运行 Core 构建系统测试,64 项通过(含 1024 字节通过、1025 字节拒绝的非 ASCII 模式)。另有 11 项合成插件测试、5 项工作区选项测试通过。覆盖同一目录的跨插件隔离、否定规则恢复,以及零实例时的规则来源。
  • 使用实际 Go Support 清单调用生产 build.detect。六个目录在旧清单下识别 6 个,加入插件规则后识别 3 个,工作区添加 !testdata/ 后识别 4 个。
  • 用 JSON Schema 校验示例清单和 Go Support 清单,两者都通过。
  • macOS 和 Windows 桌面端的设置交互及模块同步由宿主和插件仓库验收。

Devin Review

@WhiteZeek
WhiteZeek marked this pull request as ready for review November 28, 2026 06:08
devin-ai-integration[bot]

This comment was marked as resolved.

Keep the Lithe-IDEA#218 entry as the only pending record after Lithe-IDEA#226 moved the others into the timeline.
- build.detect 总是返回 detection.pluginIgnoredPaths(没有规则时为 [],提前返回的分支也带上)
- 插件规则编译失败时只拒绝该插件(plugin.manifest.invalid,字段 buildSystems[i].detection.ignoredPaths[j]),不再让整个检测失败或记到工作区 ignoredPaths 上
- 新增固定样例 rust/fixtures/build/detect-plugin-ignored-paths-v1.json,测试改为按样例跑,并补被遮蔽声明、工作区根同名、插件 ! 规则、outermost 外层被忽略的用例
- 契约 README 与 schema 去掉"打包前调用 plugins.declarative.validate"的说法,写明规则相对工作区根匹配、宜用不锚定写法、工作区 ! 放回的做法
- 构建系统领域页中英补 detection.ignoredPaths;协议更新记录按新格式登记 Lithe-IDEA#218
@xiaoyumuxi
xiaoyumuxi merged commit 4a4cc79 into Lithe-IDEA:main Nov 29, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants